302
As a result we get:
Two Sample t-test
data: GardenA and GardenB
t = -3.873, df = 18, p-value = 0.001115
alternative hypothesis: true difference in means is not equal to
095 percent confidence interval:
-3.0849115 -0.9150885
sample estimates:
mean of x mean of y
3 5
Thus, we obtain a p-value of 0.001115. This means that we can reject the null hypoth
esis. Accordingly, the mean ozone concentration in garden B is significantly higher than in
garden A.
We can now use a t-test to determine whether the new therapy shows a significant
improvement. Analogous to Example 19.1, we would first formulate the test hypothesis
(p-value < 0.05). The null hypothesis (H0) would be: The new therapy does not affect or
prolong the average duration of illness. The corresponding alternative hypothesis H1: The
new therapy shortens the average disease duration (one-sided test).
In R, we would use the following script:
> groupA = c(7, 8, 11, 10, 9, 11, 13)
> groupB = c(9, 7, 9, 11, 6, 11, 11, 8)
> t.test(groupA,groupB,var.equal=T)
Example 19.2
19.2
Table 19.2 Effect of a new therapy (group A = conventional therapy; group B = new therapy; dura
tion of illness in days)
Group A
Group B
7
9
8
7
11
9
11
11
10
6
9
11
11
11
13
8
19 Tutorial: An Overview of Important Databases and Programs